<template>
	<!-- 首页和跑团活动组件 -->
	<view class="">
		<view class="i_tiplist" v-if="tipList.length">
			<view class="tiplist_list" @click="detail(item.id,index)" v-for="(item, index) in tipList" :key="index">
				<view class="tiplist_top">
					<view class="tiplist_top_pic">
						<image :src="item.cover" mode=""></image>
						<!-- 查看人数 -->
						<view class="look">
							<i class="icon">&#xe6a0;</i>
							{{ item.browse }}
						</view>
						<!-- 赛事活动任务 -->
						<view class="kind">
							<image v-if="item.type == 1" src="https://ykp-new.oss-cn-hangzhou.aliyuncs.com/client/discover/run_recomm.png" mode="widthFix"></image>
							<image v-else-if="item.type == 3" src="https://ykp-new.oss-cn-hangzhou.aliyuncs.com/client/discover/run_renwu.png" mode="widthFix"></image>
							<image v-else src="https://ykp-new.oss-cn-hangzhou.aliyuncs.com/client/discover/run_active.png" mode="widthFix"></image>
						</view>
					</view>
					<view class="tiplist_top_info">
						<view class="tiplist_top_title">
							<span v-if="item.official">官方</span>
							{{ item.name }}
						</view>
						<view class="tiplist_top_message">
							<view class="tiplist_top_message_t">
								<view class="tiplist_top_message_date">{{ item.start_time_begin }}</view>
							</view>
							<view class="tiplist_top_message_t">
								<view class="tiplist_top_message_area">{{ item.city }}</view>
								<view class="tiplist_top_message_people" v-if="item.distance >= 1">{{ item.distance_point_l }}km</view>
								<view class="tiplist_top_message_people" v-else>{{ item.distance * 1000 }}m</view>
							</view>
						</view>
					</view>
				</view>
				<!-- 跑团名称及状态 -->
				<view class="tiplist_bottom">
					<view class="tiplist_name">
						{{ item.club_name }}
						<image v-if="item.club_cation" src="https://ykp-new.oss-cn-hangzhou.aliyuncs.com/client/other/group_logo.png" mode=""></image>
					</view>
					<view class="tiplist_state">
						<span v-if="item.state == 0">报名中</span>
						<span class="hasend" v-else-if="item.state == 1">报名已结束</span>
						<span class="hasend" v-else-if="item.state == 2">报名未开始</span>
						<span class="hasend" v-else-if="item.state == 3">已结束</span>
						<span v-else>进行中</span>
					</view>
				</view>
			</view>
		</view>
		<view class="noList" v-else>
			<view class="content">
				<image src="https://ykp-new.oss-cn-hangzhou.aliyuncs.com/client/index/nodata.png" mode=""></image>
				<text>无数据</text>
			</view>
		</view>
	</view>
</template>

<script>
export default {
	props: ['tipList', 'more'],
	data() {
		return {
			listIndex: ''
		};
	},

	methods: {
		detail(key,index) {
			this.listIndex = index
			this.$emit('todetail', key);
			this.tipList[index].browse ++
			 // console.log (this.tipList[index].browse);
		}
	}
};
</script>

<style lang="less" scoped>
	.noList {
		background-color: #FFFFFF;
		text-align: center;
		overflow: hidden;
		image {
			display: block;
			margin: auto;
			width: 200upx;
			height: 180upx;
			margin-top: 200upx ;
			margin-bottom: 20upx ;
		}
		text {
			font-size: 32upx;
			color: #999999;
		}
	}
.uni-loadmore {
	text-align: center;
	font-size: 28upx;
	height: 60upx;
	line-height: 60upx;
}
.i_tiplist {
	background-color: #ffffff;
	padding: 0 30upx;
	.tiplist_top {
		width: 100%;
		height: 168upx;
		display: flex;
		justify-content: space-between;
		.tiplist_top_pic {
			width: 300upx;
			height: 168upx;
			margin-right: 20upx;
			border-radius: 10upx;
			position: relative;
			overflow: hidden;
			.look {
				position: absolute;
				bottom: 0;
				height: 36upx;
				width: 100%;
				display: flex;
				justify-content: flex-end;
				align-items: center;
				padding: 0 20upx;
				box-sizing: border-box;
				background-color: rgba(0, 0, 0, 0.4);
				font-size: 20upx;
				color: #ffffff;
				.icon {
					font-size: 16upx;
					color: #ffffff;
					margin-right: 10upx;
				}
			}
			image {
				width: 100%;
				height: 100%;
				border-radius: 10upx;
			}
			.kind {
				position: absolute;
				width: 44upx;
				height: 40upx;
				top: 0;
				background-color: ;
				left: 26upx;
				image {
					width: 100%;
					height: 100%;
					border-radius: 0;
				}
			}
		}
		.tiplist_top_info {
			flex: 1;
			display: flex;
			flex-direction: column;
			justify-content: space-between;
			.tiplist_top_title {
				font-size: 28upx;
				line-height: 36upx;
				color: #333333;
				font-weight: bold;
				overflow: hidden;
				text-overflow: ellipsis;
				display: -webkit-box; //作为弹性伸缩盒子模型显示。
				-webkit-box-orient: vertical; //设置伸缩盒子的子元素排列方式--从上到下垂直排列
				-webkit-line-clamp: 2; //显示的行
				span {
					display: inline-block;
					width: 64upx;
					height: 32upx;
					background-color: #8738d2;
					border-radius: 4upx;
					color: #ffffff;
					text-align: center;
					line-height: 32upx;
					font-size: 24upx;
					margin-right: 14upx;
				}
			}
			.tiplist_top_message .tiplist_top_message_t {
				display: flex;
				justify-content: space-between;
				.tiplist_top_message_date {
					font-size: 24upx;
					color: #666;
					line-height: 50upx;
				}
				.tiplist_top_message_people {
					font-size: 24upx;
					color: #fe6601;
				}
			}
			.tiplist_top_message_area {
				font-size: 24upx;
				color: #666;
			}
		}
	}
	.tiplist_bottom {
		display: flex;
		justify-content: space-between;
		height: 80upx;
		align-items: center;
		border-bottom: 1upx solid #e1e1e1;
		.tiplist_name {
			font-size: 26upx;
			color: #333333;
			display: flex;
			align-items: center;
			.icon {
				font-size: 26upx;
				margin-left: 6upx;
			}
			image {
				width: 24upx;
				height: 26upx;
				margin-left: 8upx;
			}
		}
		.tiplist_state {
			font-size: 28upx;
			color: #8839d2;
			font-weight: bold;
			.hasend {
				color: #c1c1c1;
			}
		}
	}
}
.tiplist_list {
	padding-top: 20upx;
}
.tiplist_list:last-child {
	.tiplist_bottom {
		border-bottom: 0;
	}
}
</style>
